package com.lovo.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lovo.project.bean.Data2Bean;
import com.lovo.project.bean.SaleInBean;
import com.lovo.project.mapper.SaleInMapper;
import com.lovo.project.service.SaleInService;
import com.lovo.project.service.SaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SaleInServiceImpl extends ServiceImpl<SaleInMapper, SaleInBean> implements SaleInService {
    @Autowired
    SaleInMapper saleInMapper;

    @Override
    public Page<SaleInBean> querySaleInList(Page<SaleInBean> page, QueryWrapper queryWrapper) {

        Page<SaleInBean> page1=saleInMapper.selectPage(page,queryWrapper);
        return page1;
    }

    @Override
    public SaleInBean querySaleIn(Integer id) {
        SaleInBean saleInBean=saleInMapper.selectById(id);
        return saleInBean;
    }

    @Override
    public List<String> queryYear() {
        List<String> list=saleInMapper.queryYearList();
        return list;
    }

    @Override
    public List<Data2Bean> queryData2BeanList(String year) {
        List<Data2Bean> list=saleInMapper.selectAllByData2Bean(year);
        return list;
    }
}
